//
// Created by hps on 24-4-6.
//

#ifndef LINENUMBERAREA_H
#define LINENUMBERAREA_H

#include "HeadFiles.h"
#include "TextEdit.h"

namespace hps {

class LineNumberArea : public QWidget
{
public:
    LineNumberArea() = default;
    LineNumberArea(TextEdit *editor) : QWidget(editor), codeEditor(editor) {}

    QSize sizeHint() const override
    {
        return QSize(codeEditor->lineNumberAreaWidth(), 0);
    }

protected:
    void paintEvent(QPaintEvent *event) override
    {
        codeEditor->lineNumberAreaPaintEvent(event);
    }

private:
    TextEdit *codeEditor;
};

} // hps

#endif //LINENUMBERAREA_H
